package plugin.eos.awake.flutter.awake1.network;

import com.google.gson.JsonObject;
import com.oraclechain.pocketeos.bean.Account;
import com.oraclechain.pocketeos.bean.ForceAccountBean;
import com.oraclechain.pocketeos.blockchain.api.EosChainInfo;
import com.oraclechain.pocketeos.blockchain.bean.JsonToBeanResultBean;
import com.oraclechain.pocketeos.blockchain.bean.JsonToBinRequest;
import com.oraclechain.pocketeos.blockchain.chain.PackedTransaction;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * Creation time: 2018/7/26
 * Editor: $USER_NAME
 * Functional description:
 */
public interface ApiService {

    /**
     * 开元钱包开始
     */
    // 获取与节点相关的信息
    @POST("/v1/chain/get_info")
    Observable<EosChainInfo> getEosChainInfo();

    @POST("/v1/chain/abi_json_to_bin")
    Observable<JsonToBeanResultBean> jsonToBin(@Body JsonToBinRequest body);

    @POST("/v1/chain/push_transaction")
    Observable<JsonObject> 	pushTransactionRetJson(@Body PackedTransaction body);

    // 获取给定公钥下的账号列表
    @POST("history/get_key_accounts")
    @Headers({"Content-Type: application/json"})
    Observable<ForceAccountBean> getEOsKeyAccounts(@Body Account account);

}
